package leetcode.linkedlist.common;


/**
 * Definition for singly-linked list.
 */
public class ListNode {
    // 注意, 以下属性和修饰符必须是public的,才能够在其他包中被直接使用
    public int val;
    public ListNode next;
    public ListNode pre;

    public ListNode() {
    }

    public ListNode(int val) {
        this.val = val;
    }

    public ListNode(int val, ListNode next) {
        this.val = val;
        this.next = next;
    }

    public ListNode(int val, ListNode next, ListNode pre) {
        this.val = val;
        this.next = next;
        this.pre = pre;
    }
}